<?php get_header(); ?>

	<div id="main">
		<div id="content" role="main" class="no-clear blog no_addthis">
			<?php if ( is_paged() ) : ?>
				<?php if ( have_posts() ) : ?>
					<?php content_nav( 'nav-above' ); ?>
					<div id="posts" class="blog-section row-section">
						<?php while (have_posts()) : the_post() ;?>
						<?php get_template_part( 'content', get_post_format() ); ?>
						<?php endwhile; ?>
					</div>
					<?php content_nav( 'nav-below' ); ?>
				<?php else: ?>
					<article id="post-0" class="post no-results not-found">
						<header class="entry-header">
							<h1 class="entry-title"><?php _e( 'Nothing Found', 'TecBridge' ); ?></h1>
						</header><!-- .entry-header -->

						<div class="entry-content">
							<p><?php _e( 'Apologies, but there doesn\'t seem to be any posts', 'TecBridge' ); ?></p>
							<?php get_search_form(); ?>
						</div><!-- .entry-content -->
					</article><!-- #post-0 -->
				<?php endif; ?>
			<?php else : ?>
				<?php if ( have_posts() ) : ?>
					<?php content_nav( 'nav-above' ); ?>
					<?php global $wp_query; ?>
					<div id="first-post" class="blog-section row-section">
						<?php global $small; $small = false; ?>
						<?php if (have_posts()) : the_post(); ?>
						<?php get_template_part( 'content', get_post_format() ); ?>
						<?php $small = true; ?>
						<?php endif; ?>
					</div>
					<div id="recent-posts" class="blog-section column-section">
						<?php if ($wp_query->post_count > 0) : ?>
						<?php for ($i = $wp_query->current_post; $i < $wp_query->post_count-1 && $i < 4; $i++) : ?>
						<?php the_post();?>
						<?php get_template_part( 'content', get_post_format() ); ?>
						<?php endfor; ?>
						<?php endif; ?>
					</div>
					<div id="posts" class="blog-section row-section">
						<?php while (have_posts()) : the_post() ;?>
						<?php get_template_part( 'content', get_post_format() ); ?>
						<?php endwhile; ?>
					</div>
					<?php content_nav( 'nav-below' ); ?>
				
				<?php else : ?>
					<article id="post-0" class="post no-results not-found">
						<header class="entry-header">
							<h1 class="entry-title"><?php _e( 'Nothing Found', 'TecBridge' ); ?></h1>
						</header><!-- .entry-header -->

						<div class="entry-content">
							<p><?php _e( 'Apologies, but there doesn\'t seem to be any posts', 'TecBridge' ); ?></p>
							<?php get_search_form(); ?>
						</div><!-- .entry-content -->
					</article><!-- #post-0 -->
				<?php endif; ?>
			<?php endif; ?>
		</div>
	</div>
<?php get_footer(); ?>	
